#pragma once

#include <cmath>
#include <assert.h>


//Function make logarithmic conversion from less range (value from less range - x) 
//to greater range (value from greater range - returned value).
//maxX - maximal value of less range
//maxY - maximal value of greater range
inline long conversionFunction(long double x, long double maxX, long double maxY)
{
	assert(x > -1);
	if(x != 0)
		return static_cast<long>(((std::log10l(x)*maxY)/std::log10l(maxX))-maxY);
	else
		return static_cast<long>(-maxY);
}